package onki.tests;

import java.util.ArrayList;
import onki.tests.pageObjects.OnkiAlphabeticalPageObject;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.PageFactory;

@Test(dependsOnGroups = "statistics", groups = {"alphabetical"})
public class YsoAlphabeticalListingTests extends OnkiTestBase {

  private WebDriver driver;
  private OnkiAlphabeticalPageObject page;

  public YsoAlphabeticalListingTests() {
  }

  public void defaultPageTitleCorrect() {
    assertTrue(this.driver.getTitle().contentEquals("ONKI: YSO: Alphabetical index: A"));
  }

  @BeforeClass
  public void setUp() {
    driver = new FirefoxDriver();
    this.page = loadConcept("en");
  }

  @AfterClass
  public void tearDown() {
    driver.quit();
  }

  public OnkiAlphabeticalPageObject loadConcept(String lang) {
    this.driver.get(baseUrl + "yso/" + lang + "/index");
    OnkiAlphabeticalPageObject cat = PageFactory.initElements(this.driver, OnkiAlphabeticalPageObject.class);
    return cat;
  }
}
